Communication apparatus

ABSTRACT

A communication apparatus may determine whether a first external apparatus is a target apparatus by referring content of a predetermined area included in a first connection request, in a case where the first connection request is received from the first external apparatus via a wireless interface, under a state where the communication apparatus operates in a first operation mode, and establishes a first wireless communication with the first external apparatus in a case where it is determined that the first external apparatus is the target apparatus. A wireless communication with the first external apparatus may not be established in a case where it is determined that the first external apparatus is not the target apparatus. The communication apparatus may store setting information in a setting area in a memory in a case where the setting information is received from the first external apparatus by using the first wireless connection.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. application Ser. No.15/279,475, filed Sep. 29, 2016, which claims priority to JapanesePatent Application No. 2015-192158, filed on Sep. 29, 2015, the entirecontents of which are hereby incorporated by reference into the presentapplication.

TECHNICAL FIELD

The present disclosure relates to a communication apparatus whichreceives setting information from an external and stores the settinginformation in a memory.

BACKGROUND ART

A technique relating to a wireless connection of a first printer and asecond printer is known. The first printer has established a wirelessconnection with an access point, and is storing a network wirelesssetting for establishing a wireless connection with the access point.The first printer establishes a wireless connection with the secondprinter by using an ad hoc wireless setting, and sends the networkwireless setting to the second printer. Thereby, the second printer canestablish a wireless connection with the access point by using thenetwork wireless setting.

SUMMARY

In the technique described above, there is a possibility that forexample, if the second printer establishes a wireless connection with anapparatus different from the first printer in a situation where thenetwork wireless setting is to be received from the first printer, thesecond printer cannot receive the network wireless setting from thefirst printer. The present disclosure relates to a technique which, in asituation where setting information is to be received from a targetapparatus which is to send the setting information to a communicationapparatus, allows the communication apparatus to properly receive thesetting information from the target apparatus.

A communication apparatus may comprise a wireless interface; aprocessor; and a memory comprising a setting area for storing settinginformation which is to be used by the communication apparatus, whereinthe memory may store computer-readable instructions therein, and thecomputer-readable instructions, when executed by the processor, maycause the communication apparatus to execute: operating in one of aplurality of operation modes including a first operation mode forreceiving the setting information from a target apparatus so as to storethe setting information in the setting area, the target apparatus beingto send the setting information to the communication apparatus;determining whether a first external apparatus is the target apparatusby referring a content of a predetermined area included in a firstconnection request in a case where the first connection request isreceived from the first external apparatus via the wireless interfaceunder a state where the communication apparatus operates in the firstoperation mode; establishing a first wireless connection with the firstexternal apparatus via the wireless interface in a case where it isdetermined that the first external apparatus is the target apparatus,wherein a wireless connection with the first external apparatus via thewireless interface is not established in a case where it is determinedthat the first external apparatus is not the target apparatus; andstoring the setting information in the setting area in a case where thesetting information is received from the first external apparatus byusing the first wireless connection.

A control method and computer-readable instructions for implementationof the communication apparatus described above, and a non-transitorycomputer-readable recording medium in which the computer-readableinstructions are stored, are also novel and useful. Moreover, acommunication system comprising the communication apparatus describedabove and specific external apparatus is also novel and useful.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a configuration of a communication system;

FIG. 2 shows a flowchart of a process at a time when power is turned ON;

FIG. 3 shows a flowchart of a standby mode process;

FIG. 4 shows a flowchart of a setting process and a connection printprocess;

FIG. 5 shows a sequence diagram of a case A1 in which a printer operatesin a setting mode;

FIG. 6 shows a sequence diagram of a case B in which the printeroperates in the connection print mode;

FIG. 7 shows a sequence diagram of a second embodiment;

FIG. 8 shows a sequence diagram of a third embodiment; and

FIG. 9 shows a sequence diagram of a fourth embodiment.

EMBODIMENTS First Embodiment Configuration of Communication System 2

As shown in FIG. 1, a communication system 2 comprises a printer 100 anda terminal apparatus 200. The printer 100 is capable of establishing awireless connection with the terminal apparatus 200 and forming awireless network to which the printer 100 and the terminal apparatus 200belong. The terminal apparatus 200 has established a wireless connectionwith an AP (abbreviation of Access Point) 10, and is participating inthe wireless network formed by the AP 10. Moreover, below, network maybe described as “NW”.

Configuration of Printer 100

The printer 100 comprises an operation unit 112, a display unit 114, anetwork interface (called “network I/F” below) 116, a print engine 118,and a controller 130. The operation unit 112 comprises a plurality ofkeys, and accepts operations of a user. The display unit 114 is adisplay for displaying various information, and also functions as aso-called touch panel. That is, the display unit 114 also functions asan operation unit. Below, the reference numbers 112, 114 will be omittedat locations where the operation units of the printer 100 are described,and the operation units of the printer 100 will be referred to simply as“operation units”. The print engine 118 comprises printing mechanismsuch as an ink jet scheme, laser scheme, etc.

The network I/F 116 is an I/F for executing a wireless communication inaccordance with Wi-Fi scheme, and is assigned a MACpr, which is a MACaddress for identifying the I/F. The Wi-Fi scheme is a wirelesscommunication scheme conforming to the standards developed by the Wi-FiAlliance, and is a wireless communication scheme based on for example,IEEE (abbreviation of The Institute of Electrical and ElectronicsEngineers, Inc.) standard 802.11 and standards conforming thereto (forexample, 802.11a, 11b, 11g, 11n, etc.). In particular, the network I/F116 supports the Wi-Fi Direct scheme (called “WFD scheme” below).Details of the WFD scheme are described in “Wi-Fi Peer-to-Peer (P2P)Technical Specification Version 1.1” created by the Wi-Fi Alliance.Further, details of the WFD scheme are also disclosed in US PatentApplication Publication No. 2013/0260683, which is incorporated byreference into the present application.

The controller 130 comprises a CPU 132 and a memory 134. The memory 134is configured by a ROM, RAM, etc., and has stored a program 140A andpredetermined information 140B in advance before the printer 100 wasshipped. The CPU 132 executes various processes in accordance with theprogram 140A. The predetermined information 140B is information referredto by the CPU 132 during execution of the program 140A, and includes apredetermined character string “DIRECT-setup”, and wireless informationWIpr. The predetermined character string “DIRECT-setup” is a characterstring used for determining whether the printer 100 is to operate as aGroup Owner (called “G/O” below) of the WFD scheme under a state wherethe printer 100 is operating in an after-mentioned setting mode.

The wireless information WIpr is information used for establishing awireless connection with the terminal apparatus 200 and forming awireless NW under a state where the printer 100 is operating in thesetting mode, and includes an SSID (abbreviation of Service SetIdentifier) “DIRECT-target”, and a password “PWpr”. The SSID is anidentifier for identifying the wireless NW. In particular, the SSIDincluding a character string “DIRECT-” is an identifier for identifyinga wireless NW formed by the G/O, i.e., a wireless NW in accordance withthe WFD scheme. The password is a character string used forauthentication and encryption in the wireless NW.

The memory 134 further comprises a setting area 150. Wirelessinformation may be stored in the setting area 150. However, at theshipment stage of the printer 100, the wireless information is not beingstored in the setting area 150, and this is represented by a dashed linein the setting area 150 of FIG. 1. The setting area 150 is an area forstoring wireless information WIap for establishing a wireless connectionwith the AP 10. Specifically, in a case where the wireless informationWIap is received from the terminal apparatus 200, the wirelessinformation WIap is stored in the setting area 150. The wirelessinformation WIap is information used in the wireless NW formed by the AP10, and includes an SSID “xxxap” and a password “PWap”.

The memory 134 further comprises a WFD flag 160 and a G/O flag 162. TheWFD flag 160 is set to either one of two values: “ON” meaning that theprinter 100 is operating in accordance with the WFD scheme, and “OFF”meaning that the printer 100 is not operating. The G/O flag 162 is setto either one of two values: “ON” meaning that the printer 100 isoperating autonomously as G/O without executing a G/O Negotiation inaccordance with the WFD scheme, and “OFF” meaning that the printer 100is not operating.

Configuration of Terminal Apparatus 200

The terminal apparatus 200 may be a stationary apparatus such as adesktop PC or the like, or may be a portable apparatus such as anotebook PC, etc. The terminal apparatus 200 comprises an operation unit212, a display unit 214, a network I/F 216, and a controller 230. Theoperation unit 212 comprises a keyboard and a mouse, and acceptsoperations of the user. The display unit 214 is a display for displayingvarious information. The network I/F 216 is an I/F for executingwireless communication in accordance with the Wi-Fi scheme, and isassigned a MACte 200, which is a MAC address for identifying the I/F.The network I/F 216 does not support the WFD scheme. That is, theterminal apparatus 200 is a so-called legacy apparatus incapable ofexecuting a wireless communication in accordance with the WFD scheme.

The controller 230 comprises a CPU 232 and a memory 234. The CPU 232executes various processes in accordance with an OS (abbreviation ofOperating System) program 240 being stored in the memory 234. The memory234 is configured by a ROM, RAM, etc.

The memory 234 can further store a communication program 242A andpredetermined information 242B. These data 242A, 242B, are installed onthe terminal apparatus 200 from a server (not shown) on the Internetthat is provided by a vendor of the printer 100. In a modification, thedata 242A, 242B may be installed on the terminal apparatus 200 from amedia shipped together with the printer 100.

The communication program 242A is a program for sending the wirelessinformation WIap of the AP 10 to the printer 100. The predeterminedinformation 242B is information referred to by the CPU 232 duringexecution of the communication program 242A, and includes the sameinformation as the predetermined information 140B being stored in theprinter 100 (i.e., the predetermined character string, the wirelessinformation WIpr).

The memory 234 further comprises a setting area 250 similar to thesetting area 150 in the printer 100. In the state of FIG. 1, since theterminal apparatus 200 has established a wireless connection with the AP10, the wireless information WIap of the AP 10 is being stored in thesetting area 250.

In the present embodiment, further, terminal apparatuses 300, 400 whichare different from the terminal apparatus 200, are present insurroundings of the printer 100. The terminal apparatus 300 is a WFDapparatus capable of executing wireless communication in accordance withthe WFD scheme, such as a smartphone or the like. Further, like theterminal apparatus 200, the terminal apparatus 400 is a legacyapparatus.

Configuration of AP 10

The AP 10 is a known AP called a wireless AP, wireless LAN router, orthe like. The AP 10 forms a wireless NW by using, for example, thewireless information WIap determined by the user. The AP 10 establishesa wireless connection with the terminal apparatus 200 in accordancewith, for example, a so-called automatic wireless setting of WPS (Wi-FiProtected Setup) or the like, or a manual wireless setting. As a result,the wireless information WIap of the AP 10 is stored in the setting area250 of the terminal apparatus 200.

In the present embodiment, a situation is assumed in which, for example,in an environment in which a PC is participating in a wireless NW formedby the AP 10 (for example, a home wireless LAN environment), the printer100, which is newly installed, is caused to participate in the wirelessNW. In this type of situation, for example, the communication program242A is not installed on a WFD apparatus (i.e., the terminal apparatus300) such as a smartphone, but on a legacy apparatus (i.e., the terminalapparatus 200) such as a PC. Therefore, instead of establishing awireless connection with the WFD apparatus, the printer 100 needs toestablish a wireless connection with the terminal apparatus 200 which isa legacy apparatus, and receive the wireless information WIap from theterminal apparatus 200. In order to realize this, the printer 100executes the following process.

Process at Time when Power of Printer 100 is Turned ON; FIG. 2

Next, the contents of a process executed at a time when power of theprinter 100 is initially turned ON will be described with reference toFIG. 2. The time when power is initially turned ON includes the powerbeing turned on for the first time after the shipment of the printer100, and the power being turned on for the first time after aninitialization of the printer 100. At a stage where the process of FIG.2 is started, the flags 160, 162 in the printer 100 are set in OFF.Notably, the following communications and connections executed by theprinter 100 and the terminal apparatus 200 are communications andconnections via the network I/Fs 116, 216. Therefore, below, thedescription “via the network I/F 116 (or 216)” will be omitted.

In S12, the CPU 132 causes the printer 100 to operate in the settingmode. The setting mode is an operation mode for receiving the wirelessinformation WIap of the AP 10 from the terminal apparatus 200, andstoring the wireless information WIap in the setting area 150. In S14,the CPU 132 changes the WFD flag 160 to ON. Thereby, the printer 100reaches a state of being able to execute the communications (forexample, S20, S40 of FIG. 2, etc.) via the network I/F 116.

Next, in S20, the CPU 132 monitors whether a probe request is receivedfrom an external. The probe request is a signal for searching for aconnection target of a wireless connection, and includes an SSID areafor describing an SSID of the wireless NW formed by the connectiontarget. That is, a probe request in which an SSID (i.e., characterstring) is described in the SSID area is a signal for searching for anapparatus forming the wireless NW identified by that SSID, i.e., anapparatus operating as a parent station of the wireless NW. On the otherhand, a probe request in which nothing is described in the SSID area isa signal for searching for any apparatus capable of receiving therequest. Both when receiving a probe request in which a character stringis described in the SSID area, and when receiving a probe request inwhich a character string is not described in the SSID area, the CPU 132determines YES in S20, and proceeds to S22. Moreover, in the presentembodiment, the CPU 132 does not send a probe response to the proberequest received in S20 but, in a modification, may send the response.

In S22, the CPU 132 determines whether the predetermined characterstring “DIRECT-setup” in the predetermined information 140B is describedin the SSID area in the probe request received in S20. In a case wherenothing is described in the SSID area, or in a case where a characterstring different from the predetermined character string is described inthe SSID area, the CPU 132 determines NO in S22, and returns to S20. Onthe other hand, in a case where the predetermined character string isdescribed in the SSID area, the CPU 132 determines YES in S22, andproceeds to S30. Moreover, at the stage of S20 and S22 the printer 100is not operating as a parent station of the wireless NW. Therefore, theprobe request for which YES is determined in S22 is not a signal forsearching for the printer 100 operating as the parent station of thewireless NW, but is a signal having a role of trigger for causing theprinter 100 to operate as the G/O (i.e., parent station).

Further, simultaneously with the monitoring of S20, in S24 the CPU 132monitors whether a predetermined period of time has lapsed since thepower of the printer 100 was initially turned ON. When the predeterminedperiod of time has lapsed without receiving the probe request in whichthe predetermined character string is described in the SSID area (NO inS20 or NO in S22), the CPU 132 determines YES in S24, skips S30 to S52,and proceeds to S60.

In S30, the CPU 132 changes the G/O flag 162 to ON, causing the printer100 to operate as G/O. As a result, a wireless NW in which the wirelessinformation WIpr in the predetermined information 140B is used, i.e., awireless NW identified by the SSID “DIRECT-target” in the wirelessinformation WIpr, is formed. At this stage, only the printer 100 belongsto the wireless NW. When S30 ends, the process proceeds to S40.

In S40, the CPU 132 monitors whether a probe request is received from anexternal. Both when receiving a probe request in which a characterstring is described in the SSID area, or when receiving a probe requestin which a character string is not described in the SSID area, the CPU132 determines YES in S40, and proceeds to S42.

In S42, the CPU 132 determines whether the apparatus that is a sender ofthe probe request received in S40 is a target apparatus. The targetapparatus is an apparatus (in the present embodiment, the terminalapparatus 200) which is to send the wireless information WIap to theprinter 100 in accordance with the communication program 242A. In orderto search for a connection target with which a wireless connection inaccordance with the WFD scheme is to be established, a WFD apparatuswhich supports the WFD scheme sends a probe request in which thecharacter string “DIRECT-” is described in the SSID area. The characterstring “DIRECT-” is a character string in which nothing is describedafter the hyphen, and is a character string indicating that operation inaccordance with the WFD scheme is being executed. On the other hand, inorder to search for a connection target with which a wireless connectionin accordance with the normal WFD scheme is to be established, a legacyapparatus which does not support the WFD scheme sends a probe request inwhich nothing is described in the SSID area. As described above, in thepresent embodiment, the target apparatus with which the printer 100 isto establish a wireless connection is not the WFD apparatus, but thelegacy apparatus (i.e., the terminal apparatus 200). Therefore, in acase where nothing is described in the SSID area in the probe requestreceived in S40, i.e., in a case where the probe request is receivedfrom a legacy apparatus, the CPU 132 determines YES in S42, and proceedsto S50. On the other hand, in a case where the character string“DIRECT-” is described in the SSID area, i.e., in a case where the proberequest is received from a WFD apparatus, the CPU 132 determines NO inS42, and returns to S40. Moreover, even if a character string differentfrom the character string “DIRECT-” is being described in the SSID area,the CPU 132 determines NO in S42, and returns to S40. However, in amodification, in a case where for example, a predetermined characterstring is described in the SSID area (for example, the character string“DIRECT-target” in the predetermined information 140B), the CPU 132 maydetermine YES in S42.

Further, simultaneously with the monitoring of S40, in S44 the CPU 132monitors whether a predetermined period of time has lapsed since theprocess of S30 ended. When the predetermined period of time has lapsedwithout receiving a probe request in which nothing is described in theSSID area (NO in S40, or NO in S42), the CPU 132 determines YES in S44,skips S42 to S52, and proceeds to S60.

In S50, the CPU 132 sends to the terminal apparatus 200, which is thetarget apparatus, a probe response including the SSID “DIRECT-target”for identifying the wireless NW formed in S30. Then, in S52, the CPU 132executes a setting process (see FIG. 4, to be described). The settingprocess includes establishing a wireless connection with the terminalapparatus 200 by using the wireless information WIpr, and includescausing the terminal apparatus 200 to participate as a child station inthe wireless NW formed in S30. The setting process further includesreceiving the wireless information WIap of the AP 10 from the terminalapparatus 200, and storing the wireless information WIap in the settingarea 150. When S52 ends, the process proceeds to S60.

In S60, the CPU 132 changes the WFD flag 160 to OFF. Thereby, theprinter 100 reaches a state of being unable to execute communicationsvia the network OF 116, for example, even if receiving a probe request,the CPU 132 does not send a probe response. Further, in a case where S30was executed, the CPU 132 changes the G/O flag 162 to OFF. Thereby, thewireless NW formed in S30 disappears.

In S62, the CPU 132 causes the printer 100 to operate in a standby mode.The standby mode is a mode of waiting until accepting an instructionfrom the user. When S62 ends, a standby mode process of FIG. 3,described next, is executed. Further, when the power is turned ON secondand subsequent times after the initial time of turning the power ON, thestandby mode process of FIG. 3 is executed without executing the processof FIG. 2. Moreover, in a modification, the process of FIG. 2 may beexecuted not only when power is initially turned ON, but also when thepower is turned ON second and subsequent times.

Standby Mode Process of Printer 100; FIG. 3

Next, the contents of the standby mode process will be described withreference to FIG. 3. At the stage where the process of FIG. 3 isstarted, the WFD flag 160 and the G/O flag 162 are set in OFF (see S60of FIG. 2).

In S110, the CPU 132 monitors whether the operation unit accepts asetting operation for causing the printer 100 to operate in the settingmode. In a case where the operation is accepted, i.e., in a case wherean instruction for causing the printer 100 to operate in the settingmode is given by the user, the CPU 132 determines YES in S110, andproceeds to S112.

In S112, the CPU 132 executes the same processes as S12 to S62 of FIG.2. However, if S162 and S164 are executed after the WFD flag 160 waschanged to ON in S154 (to be described later), the WFD flag 160 ismaintained in ON as long as an operation for changing the WFD flag 160to OFF is not executed by the user thereafter. Consequently, there is apossibility that the WFD flag 160 is ON at the time S112 is started. Inthis case, in S14 of FIG. 2, which is included in S112, the WFD flag 160is already ON, and consequently the CPU 132 does not change the WFD flag160. Further, in a case where the WFD flag 160 is not changed in S14 ofFIG. 2 included in S112, the CPU 132 does not change the WFD flag 160 inS60 of FIG. 2 included in S112. When S112 ends, the process returns toS110.

As described above, in the present embodiment, both in the case whenpower is initially turned ON and at the time of the setting operation, awireless NW in which the same wireless information WIpr is used isformed (S30 of FIG. 2, S30 of FIG. 2 included in S112 of FIG. 3).However, in a modification, first wireless information used in awireless NW formed when power is initially turned ON, may be differentfrom second wireless information used in a wireless NW formed at thetime of the setting operation. In this case, the predeterminedinformation 140B and the predetermined information 242B include thefirst and second wireless information, respectively.

Further, simultaneously with the monitoring of S110, in S150 the CPU 132monitors whether the operation unit accepts a WFD connection operationfor causing the printer 100 to operate in a connection print mode. In acase where the operation has been accepted, i.e., in a case where aninstruction for causing the printer 100 to operate in the connectionprint mode is given by the user, the CPU 132 determines YES in S150, andproceeds to S152.

In S152, the CPU 132 causes the printer 100 to operate in the connectionprint mode. The connection print mode is an operation mode forestablishing a wireless connection with the terminal apparatus 300,which is a WFD apparatus, and executing a print process in response to aprint execution request from the terminal apparatus 300. In a case wherethe WFD flag 160 is OFF, in S154 the CPU 132 changes the WFD flag 160 toON.

In S160, the CPU 132 monitors whether a probe request in which thecharacter string “DIRECT-” is described in the SSID area is receivedfrom the terminal apparatus 300. In a case of receiving the proberequest (YES in S160), in S162 the CPU 132 sends a probe response inwhich the character string “DIRECT-” is described in the SSID area, tothe terminal apparatus 300. That is, in S40 and S42 of FIG. 2, the CPU132 does not send a probe response even if receiving the probe requestin which the character string “DIRECT-” is described in the SSID area,but sends a probe response in a case of receiving a probe request inS160 and S162.

In S164, the CPU 132 executes a connection print process (see FIG. 5, tobe described). The connection print process includes establishing awireless connection with the terminal apparatus 300, and executing aprint process in response to a print execution request from the terminalapparatus 300. Next, in S170 the CPU 132 causes the printer 100 tooperate in the standby mode, and returns to S110.

Further, simultaneously with the monitoring of S160, in S166 the CPU 132monitors whether a predetermined period of time has lapsed since theprinter 100 started operating in the connection print mode (see S152).When the predetermined period of time has lapsed without receiving theprobe request in which the character string “DIRECT-” is described inthe SSID area (NO in S160), the CPU 132 determines YES in S166, andproceeds to S168. In S168, the CPU 132 changes the WFD flag 160 to OFFin a case where the WFD flag 160 was changed to ON in S154, butmaintains the WFD flag 160 in ON without changing in a case where theWFD flag 160 was not changed in S154. That is, the CPU 132 returns theWFD flag 160 to the state at the time of executing the operation ofS150. When S168 ends, the process returns to S110 via S170.

Setting Process; FIG. 4

Next, the contents of the setting process executed in S52 of FIG. 2 willbe described with reference to FIG. 4. At the stage where the process ofFIG. 4 is started, the WFD flag 160 and the G/O flag 162 are each set inON (see S14, S30 of FIG. 2).

In S210, the CPU 132 executes a first type of connection process forestablishing a wireless connection with the terminal apparatus 200,which is the target apparatus. Specifically, the CPU 132 executes thefirst type of connection process using the wireless information WIpr ofthe wireless NW formed in S30 of FIG. 2. From the view of a G/Oapparatus which is to operate as G/O (here, the printer 100), the firsttype of connection process includes reception of an Authenticationrequest, sending of a response thereto, reception of an Associationrequest, sending of a response thereto, and communication of a 4-wayhandshake. Both the printer 100 and the terminal apparatus 200 arecapable of storing the wireless information WIpr in advance before thecommunication of S210 is started, and executing the first type ofconnection process by using the wireless information WIpr. Therefore,the first type of connection process does not include a communication(i.e., WSC Exchange) for sending the wireless information WIpr from theG/O apparatus to a child station apparatus (here, the terminal apparatus200) which is to operate as a child station. During the course ofcommunication of the signals, the G/O apparatus receives wirelessinformation from the child station apparatus, executes authentication ofthe wireless information (i.e., authentication of the child stationapparatus) and, in a case where the authentication succeeds, establishesa wireless connection with the child station apparatus. Here, the CPU132 receives the wireless information WIpr from the terminal apparatus200, and determines that the authentication of the terminal apparatus200 has succeeded in a case where the received wireless information WIpris identical with the wireless information WIpr in the predeterminedinformation 140B. In this case, the CPU 132 establishes a wirelessconnection with the terminal apparatus 200, and causes the terminalapparatus 200 to participate in the wireless NW as a child station(i.e., legacy).

In S212, the CPU 132 receives the wireless information WIap of the AP 10from the terminal apparatus 200 not via the AP 10 by using the wirelessconnection of S210 (i.e., by using the wireless NW). Then, in S214, theCPU 132 stores the wireless information WIap in the setting area 150.Next, in S216, the CPU 132 receives a disconnection request from theterminal apparatus 200 and, as a result, disconnects the wirelessconnection of S210.

In S218, the CPU 132 attempts to establish a wireless connection withthe AP 10 by using the wireless information WIap in the setting area150. Specifically, the CPU 132 first sends a probe request in which theSSID “xxxap” in the wireless information WIap is described in the SSIDarea. In a case where the AP 10 is present in the surroundings of theprinter 100, the CPU 132 receives a probe response from the AP 10, andthen, in the same manner as S210, executes the first type of connectionprocess. However, here, the point of the printer 100 operating as achild station is different from S210 in which the printer 100 operatesas G/O (i.e., parent station). During the course of the first type ofconnection process, the CPU 132 sends the wireless information WIap tothe AP 10. Then, in a case where authentication using the wirelessinformation WIap in the AP 10 (i.e., authentication of the printer 100)succeeds, the CPU 132 establishes a wireless connection with the AP 10.That is, the CPU 132 causes the printer 100 to participate as a childstation in the wireless NW of the AP 10. When S218 ends, the settingprocess ends.

Although not shown, in a case where the establishment of a wirelessconnection with the AP 10 succeeds in S218, the CPU 132 can execute acommunication with the terminal apparatus 200 or another apparatus byusing the wireless NW of the AP 10 (i.e., via the AP 10). For example,the CPU 132 can receive a print execution request from the terminalapparatus 200 via the AP 10. In this case, the CPU 132 causes the printengine 118 to execute a print process in accordance with the printexecution request.

Connection Print Process; FIG. 4

Next, contents of the connection print process executed in S164 of FIG.3 will be described with reference to FIG. 4. At the stage where theprocess of FIG. 4 is started, the WFD flag 160 is set in ON and the G/Oflag 162 is set in OFF (see S154 of FIG. 3).

In S310, the CPU 132 receives a Negotiation request from the terminalapparatus 300, which is a WFD apparatus. The request is a signal forrequesting execution of G/O Negotiation of the WFD scheme. Next, inS312, the CPU 132 executes a G/O Negotiation with the terminal apparatus300. Specifically, the CPU 132 sends a signal including a predeterminedintent value of the printer 100 (i.e., a value indicating ease ofbecoming G/O) to the terminal apparatus 300 and, further, receives fromthe terminal apparatus 300 a signal including an intent value of theterminal apparatus 300. Then, in a case where the intent value of theprinter 100 is larger than the intent value of the terminal apparatus300, the CPU 132 determines that the printer 100 is to operate as theG/O and, in a case where the intent value of the terminal apparatus 300is larger than the intent value of the printer 100, determines that theterminal apparatus 300 is to operate as the G/O.

In S314, the CPU 132 executes a second type of connection process forestablishing a wireless connection with the terminal apparatus 300. Fromthe view of the G/O apparatus, the second type of connection processincludes reception of a Service Discovery request, sending of a responsethereto, reception of a Provision Discovery request, sending of aresponse thereto, communication of a WSC Exchange, and a communicationof each signal which is communicated in the first type of connectionprocess of S210. That is, the second type of connection process includesa communication of a signal which is not communicated in the first typeof connection process (for example, Service Discovery request, etc.) forexample. Further, the G/O apparatus generates wireless information by,for example, determining a random character string and, in the WSCExchange, sends the wireless information to a Client apparatus (called“CL apparatus” below). Thereby, both the G/O apparatus and the CLapparatus can use the same wireless information, and a wirelessconnection between the G/O apparatus and the CL apparatus isestablished. Thus, in S314, the CPU 132 establishes a wirelessconnection in which the printer 100 operates as the G/O in a case ofdetermining in S312 that the printer 100 is to operate as the G/O, andestablishes a wireless connection in which the printer 100 operates asthe CL in a case of determining in S312 that the printer 100 is tooperate as the CL.

In S316, the CPU 132 receives a print execution request from theterminal apparatus 300 not via the AP 10 by using the wirelessconnection of S314. The print execution request is a command forrequesting the printer 100 to execute the print process, and includesprint data representing a target image of a print target. In S318, theCPU 132 provides the print data to the print engine 118, and causes theprint engine 118 to execute a print of the target image.

In S320, the CPU 132 disconnects the wireless connection of S314. In thecase where the printer 100 is the G/O apparatus, the CPU 132 receives adisconnection request from the terminal apparatus 300, and disconnectsthe wireless connection. Further, in the case where the printer 100 isthe CL apparatus, the CPU 132 sends a disconnection request to theterminal apparatus 300, and disconnects the wireless connection. WhenS320 ends, the connection print process ends.

Case A1; FIG. 5

Next, specific cases implemented by the processes of FIG. 2 to FIG. 4will be described with reference to FIG. 5 and FIG. 6. First, a case A1in which the printer 100 operates in the setting mode will be describedwith reference to FIG. 5. In an initial state of FIG. 5, the terminalapparatus 200 has established a wireless connection with the AP 10.Therefore, the wireless information WIap is being stored in the settingarea 250.

In T10, in the printer 100, the power is initially turned on (thetrigger of the process of FIG. 2), or the setting operation is executed(YES in S110 of FIG. 3). In this case, in T12, the printer 100 operatesin the setting mode (S12) and, in T14, changes the WFD flag 160 to ON(S14).

In the present case, after T14, in a case where the user of the terminalapparatus 300, which is not the target apparatus, desires to establish awireless connection with the printer 100, the user executes apredetermined operation in the terminal apparatus 300. In this case, inT20, the terminal apparatus 300 broadcasts a probe request in which thecharacter string “DIRECT-”, indicating it is operating in accordancewith the WFD scheme, is described in the SSID area.

Even if receiving the request of T20 (YES in S20), the printer 100determines that the predetermined character string “DIRECT-setup” is notdescribed in the SSID area in the request (NO in S22), and does not senda probe response to the request. Thereby, the phenomenon of the printer100 establishing a wireless connection with the terminal apparatus 300does not occur.

In T30, the terminal apparatus 200 accepts an install operation forinstalling the communication program 242A and the predeterminedinformation 242B in the terminal apparatus 200. In this case, theterminal apparatus 200 installs and starts the communication program242A, and executes the processes below in accordance with thecommunication program 242A. In T32, the terminal apparatus 200broadcasts a probe request in which the predetermined character string“DIRECT-setup” is described in the predetermined information 242B in theSSID area.

Upon receiving the request of T32 (YES in S20), the printer 100determines that the predetermined character string “DIRECT-setup” isdescribed in the SSID area in the request (YES in S22) and, in T34changes the G/O flag 162 to ON (i.e., operates autonomously as the G/O),forming the wireless NW in which the wireless information WIpr is used(S30).

As described above, even if sending the probe request of T20, theterminal apparatus 300 does not receive a probe response from theprinter 100. Therefore, in T40, the terminal apparatus 300 re-broadcaststhe probe request.

Even if receiving the request of T40 (YES in S40), since the characterstring “DIRECT-” is described in the SSID area in the request, theprinter 100 determines that the terminal apparatus 300, which is thesender of the request, is not the target apparatus (NO in S42), and doesnot send a probe response to the request. Thereby, the phenomenon of theprinter 100 establishing a wireless connection with the terminalapparatus 300 does not occur.

On the other hand, after sending the request of T32, in T50 the terminalapparatus 200 broadcasts a probe request in which nothing is describedin the SSID area.

Upon receiving the request of T50 (YES in S40), since nothing isdescribed in the SSID area in the request, the printer 100 determinesthat the terminal apparatus 200, which is the sender of the request, isthe target apparatus (YES in S42) and, in T52, sends to the terminalapparatus 200 a probe response in which the SSID “DIRECT-target” isdescribed in the SSID area (S50). Thereby, the printer 100 executes theprocess below for establishing a wireless connection with the terminalapparatus 200. That is, in T54, the printer 100 executes the first typeof connection process using the wireless information WIpr, andestablishes a wireless connection with the terminal apparatus 200 (S210of FIG. 4). As a result, a state is constructed in which both theprinter 100 and the terminal apparatus 200 belong to the wireless NW.

Upon receiving the response of T52, the terminal apparatus 200determines that the wireless information WIpr including the SSID“DIRECT-target” in the response is being stored in the terminalapparatus 200 (see the predetermined information 242B) and, in T54,executes the first type of connection process using the wirelessinformation WIpr, establishing a wireless connection with the printer100. Next, in T60, the terminal apparatus 200 sends the wirelessinformation WIap in the setting area 250 to the printer 100 by using thewireless connection of T54.

Upon receiving the wireless information WIap of T60 (S212), in T62 theprinter 100 stores the wireless information WIap in the setting area 150(S214) and, in T64 disconnects the wireless connection of T54 (S216).Then, in T70, the printer 100 executes the first type of connectionprocess using the wireless information WIap in the setting area 150, andestablishes a wireless connection with the AP 10 (S218). Thereby, astate is constructed in which both the printer 100 and the terminalapparatus 200 belong to the wireless NW of the AP 10.

Next, in T80 the printer 100 changes the WFD flag 160 and the G/O flag162 to OFF (S60 of FIG. 2) and, in T82, operates in the standby mode(S62).

As described above, since the printer 100 operates in the setting modewhen power is initially turned ON or at the time of the settingoperation (T12), once the communication program 242A is installed in theterminal apparatus 200 (i.e., the target apparatus) accompanied byinitially turning ON the power or with the setting operation (T30), awireless connection with the terminal apparatus 200 is established(T54), and the wireless information WIap can be received from theterminal apparatus 200 (T60). Therefore, the printer 100 can participatein the wireless NW of the AP 10 by using the wireless information WIap(T70). It is sufficient for the user to install the communicationprogram 242A in the terminal apparatus 200, and the user does not needto execute another operation for causing the printer 100 to participatein the wireless NW of the AP 10 (for example, an operation of enteringthe wireless information WIap directly to the printer 100). Therefore,it is possible to improve convenience for the user. Then, although notshown, the printer 100 can execute communication with the apparatuses(for example, the terminal apparatus 200) participating in the wirelessNW of the AP 10.

Here, adoption of a configuration of a first comparative example isassumed in which, in a case of receiving the probe request of T20 fromthe terminal apparatus 300, which is not the target apparatus, theprinter 100, which is in a state of not operating as the G/O (i.e., thestate before T34), sends to the terminal apparatus 300 the proberesponse in which the character string “DIRECT-” is described in theSSID area. In this case, the printer 100 executes the same processes asS310 to S314 of FIG. 4, and can establish, with the terminal apparatus300, a wireless connection in which the printer 100 operates as G/O orCL. Further, adoption of a configuration of a second comparative exampleis assumed in which, in a case of receiving the probe request of T40from the terminal apparatus 300, which is not the target apparatus, theprinter 100, which is in a state of operating as the G/O (i.e., thestate after T34), sends to the terminal apparatus 300 a probe responsein which the character string “DIRECT-target” is described in the SSIDarea. In this case, if for example, the predetermined information 242Bhas been installed in the terminal apparatus 300, and the terminalapparatus 300 is storing the wireless information WIpr, the printer 100executes the same process as S210 of FIG. 4, and can establish, with theterminal apparatus 300, a wireless connection in which the printer 100operates as the G/O. Thus, in the configurations of the first and secondcomparative examples, the printer 100 can establish a wirelessconnection with the terminal apparatus 300.

For example, under a state where a wireless connection in which theprinter 100 operates as the CL has been established with the terminalapparatus 300, the printer 100 cannot further establish a wirelessconnection with another apparatus. Further, for example it is assumedthat a maximum number of child stations which can participate in thewireless NW in which the printer 100 operates as the G/O is determinedas “1”. In this case, under a state where a wireless connection in whichthe printer 100 operates as the G/O has been established with theterminal apparatus 300, the printer 100 cannot further establish awireless connection with another apparatus. Consequently, in either ofthe above states, the printer 100 does not establish a wirelessconnection with the terminal apparatus 200 even if receiving the proberequest of T50 from the terminal apparatus 200. Further, for example,even if the maximum number is “2” or more, when establishing a wirelessconnection with the terminal apparatus 300, the printer 100 can receivea print execution request from the terminal apparatus 300. That is, itis possible that the printer 100 executes a print process in response tothe print execution request from the terminal apparatus 300 and, whileexecuting this process, the printer 100 cannot establish a wirelessconnection with the terminal apparatus 200 even if receiving the proberequest of T50 from the terminal apparatus 200.

By contrast, in the present embodiment, even if receiving the proberequest of T20 or T40 from the terminal apparatus 300, the printer 100does not send a probe response to the terminal apparatus 300. Therefore,it is possible to suppress the phenomenon of the printer 100establishing a wireless connection with the terminal apparatus 300,which is not the target apparatus, while the printer 100 is operating inthe setting mode. As a result, the printer 100 can properly establish awireless connection with the terminal apparatus 200, which is the targetapparatus, and consequently the wireless information WIap can beproperly received from the terminal apparatus 200.

It should be noted that in a modification, the printer 100 sends a proberesponse to the probe request of T20 to the terminal apparatus 300 but,by not executing the subsequent processes (for example, the G/ONegotiation, etc.) for establishing a wireless connection with theterminal apparatus 300, the printer 100 may not establish a wirelessconnection with the terminal apparatus 300. Further, the printer 100sends a probe response to the request of T40 to the terminal apparatus300 but, by not executing the subsequent processes (for example, sendinga response to the Authentication request, etc.) for establishing awireless connection with the terminal apparatus 300, the printer 100 maynot establish a wireless connection with the terminal apparatus 300.Even with this type of configuration, also, it is possible to suppressthe phenomenon of the printer 100 establishing a wireless connectionwith the terminal apparatus 300 which is not the target apparatus.

Further, adoption of a configuration of a third comparative example isassumed in which, when power is initially turned ON, the printer 100automatically operates as the G/O even without receiving the proberequest in which the predetermined character string “DIRECT-setup” isdescribed in the SSID area. In this case, even in a situation in whichthe communication program 242A is not installed in the terminalapparatus 200 accompanied by the power of the printer 100 beinginitially turned ON, i.e., in a situation where it is not necessary toestablish a wireless connection with the terminal apparatus 200, theprinter 100 automatically operates as the G/O. Since the printer 100operating as the G/O periodically sends a beacon signal for notifyingits presence to surrounding apparatuse(s), there is a higher powerconsumption than the state of not being the G/O. That is, in theconfiguration of the third comparative example, there is a possibilityof wasteful power consumption in the printer 100 as a result of theprinter 100 operating unnecessarily as the G/O. By contrast, since inthe present embodiment, the printer 100 does not operate as the G/O in asituation where the printer 100 does not need to establish a wirelessconnection with the terminal apparatus 200 (NO in S20, or NO in S22, ofFIG. 2), power saving of the printer 100 can be realized.

Case B; FIG. 6

Next, a case B in which a WFD connection operation is executed in theprinter 100 will be described with reference to FIG. 6. In an initialstate of case B, the printer 100 is participating in the wireless NW ofthe AP 10 (T70 of FIG. 5). However, the terminal apparatus 300 is notparticipating in the wireless NW of the AP 10.

In T110, under a state of operating in the standby mode, the printer 100accepts the WFD connection operation (YES in S150 of FIG. 3). In thiscase, in T112 the printer 100 operates in the connection print mode(S152) and, in T114, changes the WFD flag 160 to ON (S154).

In a case where a predetermined operation is accepted, in T120 theterminal apparatus 300 broadcasts a probe request in which the characterstring “DIRECT-” is described in the SSID area. The predeterminedoperation includes an operation of designating an image filerepresenting a target image of a print target.

Upon receiving the request of T120 (YES in S160), in T122 the printer100 sends, to the terminal apparatus 300, a probe response in which thecharacter string “DIRECT-” is described in the SSID area (S162). Then,in T130, the printer 100 receives a Negotiation request from theterminal apparatus 300 (S310 of FIG. 4) and, in T132, executes a G/ONegotiation with the terminal apparatus 300 (S312). As a result, inT134, the printer 100 determines that the printer 100 is to operate asthe G/O or the CL and, in T136, the terminal apparatus 300 determinesthat the terminal apparatus 300 is to operate as the CL or the G/O.Then, in T138, the second type of connection process is executed inwhich the wireless information determined by the G/O apparatus is used,establishing a wireless connection between the printer 100 and theterminal apparatus 300 (S314).

The terminal apparatus 300 has an exclusive driver program for theprinter 100, or a generic driver program for various models of printer.The terminal apparatus 300 converts the image file designated in thepredetermined operation in accordance with the driver program,generating print data that can be interpreted by the print engine 118 ofthe printer 100. Then, in T140, the terminal apparatus 300 sends a printexecution request including the print data to the printer 100.

Upon receiving the request of T140 (S316), in T142 the printer 100executes a print process in accordance with the print data in therequest (S318). Next, in T144, the printer 100 disconnects the wirelessconnection of T138 (S320) and, in T146, operates in the standby mode(S170 of FIG. 3).

As described above, in case B the printer 100 is participating in thewireless NW of the AP 10, but the terminal apparatus 300 is notparticipating in this wireless NW. Therefore, the printer 100 cannotreceive a print execution request from the terminal apparatus 300 viathe AP 10 by using the wireless NW. However, since the printer 100 isoperating in the connection print mode at the time of the WFD connectionoperation (T112), the printer 100 can establish a wireless connectionwith the terminal apparatus 300 (T138), and receive a print executionrequest from the terminal apparatus 300 (T140). Therefore, the printer100 can properly execute the print process (T142).

Correspondence Relationship

The setting mode and the connection print mode are examples of “firstoperation mode” and “second operation mode”, respectively. The settingoperation of S110 of FIG. 3, and the WFD connection operation of S150are examples of “first instruction” and “second instruction”,respectively. The wireless NW of the AP 10, and the wireless NW formedin S30 of FIG. 2 are examples of “first wireless network” and “specificwireless network”, respectively. The SSID area is an example of“predetermined area”. Nothing being described in the SSID area is anexample of “specific content”. The character string “DIRECT-” is anexample of “operating character string”.

In FIG. 5, the probe request of T32 is an example of “specificconnection request”. The probe request of T40 and the probe request ofT50 are examples of “first connection request”. The terminal apparatus200 and the terminal apparatus 300 are an example of “first externalapparatus” determined to be “target apparatus”, and “first externalapparatus” determined not to be “target apparatus”, respectively. Thewireless connection of T54, and the wireless connection of T70 areexamples of “first wireless connection” and “second wirelessconnection”, respectively. In FIG. 6, the terminal apparatus 300, theprobe request of T120, the wireless connection of T138, and the printexecution request of T140 are examples of “second external apparatus”,“second connection request”, “third wireless connection” and “executionrequest”, respectively.

Second Embodiment

In the present embodiment, the content of the determining process of S42of FIG. 2 is different from the first embodiment. As described above,the terminal apparatus 200, which is the target apparatus, is storingthe wireless information WIpr (see the predetermined information 242B ofFIG. 1). After the printer 100 has formed the wireless NW identified bythe SSID “DIRECT-target” (S30 of FIG. 2), the terminal apparatus 200sends a probe request in which the character string “DIRECT-target” inthe wireless information WIpr is described in the SSID area. The CPU 132determines YES in S42 in a case where the character string“DIRECT-target” is described in the SSID area in the probe requestreceived in S40, and determines NO in S42 in a case where the characterstring “DIRECT-target” is not described in the SSID area.

Case A2; FIG. 7

In the present embodiment, case A2 of FIG. 7 is realized instead of caseA1 of FIGS. 5. T210 to T214 are the same as T10 to T14 of FIG. 5.

In T220, as in T20 of FIG. 5, the terminal apparatus 300, which is notthe target apparatus, broadcasts a probe request in which the characterstring “DIRECT-” is described in the SSID area. Further, in the presentcase, a situation is further assumed in which, in a case where a user ofthe terminal apparatus 400, which is not the target apparatus, wishes toestablish a wireless connection with the printer 100, the user performsa predetermined operation on the terminal apparatus 400. In this case,in T220 the terminal apparatus 400, which is a legacy apparatus,broadcasts a probe request in which nothing is described in the SSIDarea. In T220, even if receiving a probe request from each of theterminal apparatuses 300, 400 (YES in S20), the printer 100 determinesthat the predetermined character string “DIRECT-setup” is not describedin the SSID area in the request (NO in S22), and does not send a proberesponse to the request. Thereby, the phenomenon does not occur in whichthe printer 100 establishes a wireless connection with any of theterminal apparatuses 300, 400.

T230 to T234 are the same as T30 to T34 of FIG. 5. In T240, each of theterminal apparatuses 300, 400 re-broadcasts a probe request. Even ifreceiving the request of T240 (YES in S40), since the character string“DIRECT-target” is not described in the SSID area in the request, theprinter 100 determines that the terminal apparatus that is the sender ofthe request is not the target apparatus (NO in S42), and does not send aprobe response to the request. Thereby, the phenomenon does not occur inwhich the printer 100 establishes a wireless connection with any of theterminal apparatuses 300, 400.

On the other hand, after having sent the request of T232, in T250, theterminal apparatus 200 broadcasts a probe request in which the characterstring “DIRECT-target” is described in the SSID area. Upon receiving therequest of T250 (YES in S40), since the character string “DIRECT-target”is described in the SSID area in the request, the printer 100 determinesthat the terminal apparatus 200 which is the sender of the request, isthe target apparatus (YES in S42) and, in T252, sends a probe responseto the terminal apparatus 200 (S50). T254 to T282 are the same as T54 toT82 of FIG. 5.

In the present embodiment, also, as in the first embodiment, it ispossible to suppress the occurrence of the phenomenon in which theprinter 100 establishes a wireless connection with the terminalapparatus 300 which is not the target apparatus, while the printer 100is operating in the setting mode. Further, even in a situation where theterminal apparatuses 200, 400 are present, these being two or morelegacy apparatuses, the printer 100 does not send a probe response tothe terminal apparatus 400 even if receiving the probe request of T220or T240 from the terminal apparatus 400 which is not the targetapparatus. Therefore, it is possible to suppress the occurrence of thephenomenon in which the printer 100, while operating in the settingmode, establishes a wireless connection with the terminal apparatus 400which is not the target apparatus. As a result, the printer 100 canproperly establish a wireless connection with the terminal apparatus 200which, of the two or more legacy apparatuses, is the target apparatus,and consequently can properly receive the wireless information WIap fromthe terminal apparatus 200.

In the present embodiment, also, the SSID area is an example of “apredetermined area”. The character string “DIRECT-target” beingdescribed in the SSID area is an example of “specific content”. Further,the SSID “DIRECT-target” is an example of “predetermined SSID”.

Third Embodiment

In the present embodiment, the content of the process of S30 of FIG. 2,and the content of the determining process of S42 are different from thefirst embodiment. As described above, the terminal apparatus 200, whichis the target apparatus, sends a probe request in which thepredetermined character string “DIRECT-setup” is described in the SSIDarea. The probe request includes a sender area in which a MAC address ofa sender apparatus is to be written, and the MACte 200, this being theMAC address of the terminal apparatus 200, is described in this senderarea. In S30, the CPU 132 stores, in the memory 134, the MACte 200described in the sender area in the probe request received in S20. TheCPU 132 determines YES in S42 in a case where the stored MACte 200 isdescribed in the sender area in the probe request received in S40, anddetermines NO in S42 in a case where the stored MACte 200 is notdescribed in the sender area.

Case A3; FIG. 8

In the present embodiment, case A3 of FIG. 8 is realized instead of caseA1 of FIGS. 5. T310 to T332 are the same as T210 to T232 of FIG. 7. TheMACte 200 is described in the sender area in the probe request of T332.

Upon receiving the request of T332, in T334 the printer 100 changes theG/O flag to ON (S30) and, in T335, stores the MACte 200 described in thesender area in the request (S30). T340 is the same as T240 of FIG. 7. Ina case where the sender of the request of T340 is the terminal apparatus300, a MACte 300, which is the MAC address of the terminal apparatus300, is described in the sender area in the request. In a case where thesender of the request of T340 is the terminal apparatus 400, a MACte400, which is the MAC address of the terminal apparatus 400, isdescribed in the sender area in the request. Even if receiving therequest of T340 (YES in S40), since the MACte 200 stored in T335 is notdescribed in the sender area in the request, the printer 100 determinesthat the terminal apparatus which is the sender of the request is notthe target apparatus (NO in S42), and does not send a probe response tothe request. Thereby, the phenomenon in which the printer 100establishes a wireless connection with any of the terminal apparatuses300, 400 does not occur.

On the other hand, after having sent the request of T332, in T350 theterminal apparatus 200 broadcasts a probe request in which nothing isdescribed in the SSID area. The MACte 200, which is the MAC address ofthe terminal apparatus 200, is described in the sender area of therequest. Upon receiving the request of T350 (YES in S40), since theMACte 200 stored in T335 is described in the sender area in the request,the printer 100 determines that the terminal apparatus 200 which is thesender of the request is the target apparatus (YES in S42) and, in T352,sends a probe response to the terminal apparatus 200 (S50). T354 to T382are the same as T54 to T82 of FIG. 5.

In the present embodiment, also, it is possible to suppress theoccurrence of the phenomenon in which the printer 100, while operatingin the setting mode, establishes a wireless connection with any of theterminal apparatuses 300, 400 which are not the target apparatuses.Therefore, the printer 100 can properly establish a wireless connectionwith the terminal apparatus 200 which is the target apparatus, andconsequently can properly receive the wireless information WIap from theterminal apparatus 200.

In the present embodiment, the sender area is an example of“predetermined area”. The MACte 200 stored in T335 is an example of “MACaddress of target apparatus”. The MACte 200 being described in thesender area is an example of “specific content”.

Fourth Embodiment

In the present embodiment, the content of the process of S30 of FIG. 2,and the content of the determining process of S42 are different from thefirst embodiment. In S30, the CPU 132 sends a probe response in responseto the probe request received in S20 to the terminal apparatus 200 whichis the target apparatus. The probe response includes a sender area inwhich a MAC address of the sender apparatus is to be written, and theMACpr, which is the MAC address of the printer 100, is described in thesender area. Thereby, the terminal apparatus 200 can know the MACpr.Thereafter, the terminal apparatus 200 sends a probe request in whichnothing is described in the SSID area. The probe request includes adestination area in which a MAC address of a destination apparatus is tobe written, and the MACpr is described in the destination area. The CPU132 determines YES in S42 in a case where the MACpr is described in thedestination area in the probe request received in S40, and determines NOin S42 in a case where the MACpr is not described in the destinationarea.

Case A4; FIG. 9

In the present embodiment, case A4 of FIG. 9 is realized instead of caseA1 of FIGS. 5. T410 to T434 are the same as T210 to T234 of FIG. 7.

In T435, the printer 100 sends a probe response in which the characterstring “DIRECT-target” is described in the SSID area, to the terminalapparatus 200 (S30 of FIG. 2). The MACpr is described in the sender areain the response. T440 is the same as T240 of FIG. 7. Informationindicating that this is a broadcast is described in the destination areain the request of T440. Even if the request of T440 is received (YES inS40), since the MACpr is not described in the destination area in therequest, the printer 100 determines that the terminal apparatus which isthe sender of the request is not the target apparatus (NO in S42), anddoes not send a probe response to the request. Thereby, the phenomenonin which the printer 100 establishes a wireless connection with any ofthe terminal apparatuses 300, 400 does not occur.

On the other hand, after sending the request of T432, in T450 theterminal apparatus 200 unicasts a probe request in which nothing isdescribed in the SSID area to the printer 100. That is, the MACpr, whichis the MAC address of the printer 100, is described in the destinationarea in the request. Upon receiving the request of T450 (YES in S40),since the MACpr is described in the destination area in the request, theprinter 100 determines that the terminal apparatus 200 which is thesender of the request is the target apparatus (YES in S42) and, in T452,sends a probe response to the terminal apparatus 200 (S50). T454 to T482are the same as T54 to T82 of FIG. 5.

In the present embodiment, also, it is possible to suppress theoccurrence of the phenomenon in which the printer 100, while operatingin the setting mode, establishes a wireless connection with the terminalapparatuses 300, 400 which are not the target apparatuses. Therefore,the printer 100 can properly establish a wireless connection with theterminal apparatus 200 which is the target apparatus, and consequentlycan properly receive the wireless information WIap from the terminalapparatus 200.

In the present embodiment, the destination area is an example of“predetermined area”. The MACpr is an example of “MAC address ofcommunication apparatus”. A state of where the MACpr is described in thedestination area is an example of “specific content”.

Modification 1

The “communication apparatus” is not restricted to the printer 100, butmay be a scanner capable of executing a scan function. In this case, ascan engine is used instead of the print engine 118. Further, S152 andS164 of FIG. 3 become a connection scan mode and connection scanprocess, in S316 of FIG. 4 a scan execution request is received and, inS318, a scan process for causing the scan engine to execute a scan isexecuted. Then, scan data is sent to the terminal apparatus by using thewireless connection of S314. In the present modification, the connectionscan mode, the scan engine and the scan execution request are examplesof “second operation mode”, “image processing engine” and “executionrequest”, respectively.

Modification 2

The “communication apparatus” may be an apparatus which executes afunction (for example, display function, calculation function) differentfrom the print function and scan function (for example, PC, server,portable terminal (mobile phone, smartphone, PDA, etc.)). In this case,S150 to S170 of FIG. 3 can be omitted. In the present modification,“second operation mode”, “establishing a third wireless connection” and“image processing engine” and “causing the image processing engine toexecute the image processing” can be omitted.

Modification 3

The “second operation mode” is not restricted to the connection printmode of the embodiments, and the connection scan mode of modification 1but alternatively, for example, may be a mode for sending a status (forexample, remaining amount of consumables, etc.) of the printer 100 to anexternal device. In this case, instead of S316 and S318 of FIG. 4, thestatus of the printer 100 is sent to the terminal apparatus 300, and thestatus is displayed in the terminal apparatus 300. Further, in a casewhere the “communication apparatus” is an apparatus which executes afunction different from the print function and scan function, such asfor example, a hard disk device or a speaker, the “second operationmode” may be, for example, a mode for receiving data from an externalapparatus, storing the data, and sound-outputting the data.

Modification 4

In the first and second embodiments, when power of the CPU 132 isinitially turned ON, the printer 100 may automatically operate as theG/O. That is, after S14 of FIGS. 2, S20 to S24 may be omitted, and S30may be executed immediately. In the present modification, “operating asa parent station of the second wireless network” may be omitted.

Modification 5

In S30 of FIG. 2, the CPU 132 may cause the printer 100 to operate as aparent station in accordance with the Soft AP scheme and, in S210 ofFIG. 4, may establish a wireless connection in accordance with the SoftAP scheme. Similarly, in S314 of FIG. 4, the CPU 132 may establish awireless connection in accordance with the Soft AP scheme. That is, the“first wireless connection” and “third wireless connection” are notrestricted to a wireless connection in accordance with the WFD scheme,but may be a wireless connection in accordance with another scheme (forexample, Soft AP scheme).

Modification 6

In S210 of FIG. 4, the CPU 132 may execute the G/O Negotiation and,further, execute the second type of connection process. Further, in acase where the terminal apparatus 200 autonomously operates as the G/O,in S210 the CPU 132 may establish a wireless connection with theterminal apparatus 200 in which the printer 100 operates as a childstation. That is, the “first wireless connection” may be a wirelessconnection in which the communication apparatus operates as a fixedstation, or may be a wireless connection in which the communicationapparatus operates as a station determined in response to acommunication (for example, G/O Negotiation) with the first externalapparatus.

Modification 7

In S310, S312 of FIG. 5, the CPU 132 may, for example, cause the printer100 to autonomously operate as the G/O without executing the G/ONegotiation (or the terminal apparatus 300 may operate autonomously asthe G/O). That is, the “third wireless connection” may be a wirelessconnection in which the communication apparatus operates as a fixedstation, or may be a wireless connection in which the communicationapparatus operates as a station determined in response to communicationwith a second external apparatus.

Modification 8

In S110 of FIG. 3, the CPU 132 may determine YES in S110 in, forexample, a case where a near field wireless communication (NFC(abbreviation of Near Field Communication) communication, a Blue Tooth(registered trademark) communication, etc.) has been executed, and asignal indicating a start of operation of the setting mode is receivedfrom the terminal apparatus 200. In the present modification, the signalis an example of “first instruction”. Similarly, the “secondinstruction” may be a signal received by a near field wirelesscommunication.

Modification 9

The “setting information” is not restricted to the wireless informationWIap of the AP 10, but may be for example, information indicating adefault print setting, or may be information indicating a telephone bookbeing stored in the terminal apparatus 200. In the present modification,“setting information” does not include “wireless information”, and“establishing a second wireless connection with the access point” may beomitted. Generally speaking, “setting information” may be anyinformation to be used (i.e., set) by the communication apparatus.

Modification 10

When power of the printer 100 is initially turned ON, the CPU 132 maynot execute the process of FIG. 2. In another modification, the CPU 132may not execute S112 of FIG. 3 at the time of the setting operation.Further, in another modification, the CPU 132 may not execute theprocesses of S150 to S170 of FIG. 3 at the time of the WFD connectionoperation. For example, the CPU 132 may regularly operate in theconnection print mode.

Modification 11

In the above embodiments, each process of FIG. 2 to FIG. 9 isimplemented by software (i.e., the programs 140A, 242A). However, atleast one process of each process of FIG. 2 to FIG. 9 may be implementedby hardware such as a logic circuit.

What is claimed is:
 1. A communication apparatus comprising: a wirelessinterface; a processor; and a memory comprising a specific area forstoring specific information which is to be used by the communicationapparatus, wherein the memory stores computer-readable instructionstherein, and the computer-readable instructions, when executed by theprocessor, cause the communication apparatus to execute: operating inone of a plurality of operation modes including a first operation modefor receiving the specific information from a target apparatus so as tostore the specific information in the specific area, the targetapparatus being configured to send the specific information to thecommunication apparatus; operating as a parent station of a specificwireless network in a case where a specific connection request includinga predetermined character string is received from the target apparatusunder a state where the communication apparatus operates in the firstoperation mode; determining whether a first external apparatus is thetarget apparatus by referring content of a predetermined area includedin a first connection request in a case where the first connectionrequest is received from the first external apparatus via the wirelessinterface after the communication apparatus has operated as the parentstation of the specific wireless network under the state where thecommunication apparatus operates in the first operation mode;establishing a first wireless connection with the first externalapparatus via the wireless interface so as to cause the first externalapparatus to participate in the specific wireless network as a childstation in a case where it is determined that the first externalapparatus is the target apparatus, wherein a wireless connection withthe first external apparatus via the wireless interface is notestablished in a case where it is determined that the first externalapparatus is not the target apparatus; and storing the specificinformation in the specific area in a case where the specificinformation is received from the first external apparatus by using thefirst wireless connection after the first wireless connection with thefirst external apparatus has been established.
 2. The communicationapparatus as in claim 1, wherein the first wireless connection isestablished with the first external apparatus by sending a response tothe first connection request to the first external apparatus via thewireless interface in the case where it is determined that the firstexternal apparatus is the target apparatus, and a response to the firstconnection request is not sent to the first external apparatus in thecase where it is determined that the first external apparatus is not thetarget apparatus.
 3. The communication apparatus as in claim 1, whereinthe specific information includes wireless information being used in afirst wireless network formed by an access point, and thecomputer-readable instructions, when executed by the processor, causingthe communication apparatus to further execute: establishing a secondwireless connection with the access point via the wireless interface byusing the wireless information included in the specific information soas to cause the communication apparatus to participate in the firstwireless network as a child station in a case where the specificinformation is received from the first external apparatus.
 4. Thecommunication apparatus as in claim 1, wherein the communicationapparatus is caused to operate in the first operation mode until apredetermined period of time has lapsed since the communicationapparatus was turned on.
 5. The communication apparatus as in claim 1,wherein the communication apparatus is caused to operate in the firstoperation mode in a case where a first instruction for causing thecommunication apparatus to operate in the first operation mode is givenunder a state where the communication apparatus does not operate in thefirst operation mode.
 6. The communication apparatus as in claim 1,wherein the determining includes: determining that the first externalapparatus is the target apparatus in a case where the content of thepredetermined area included in the first connection request is aspecific content; and determining that the first external apparatus isnot the target apparatus in a case where the content of thepredetermined area included in the first connection request is differentfrom the specific content, wherein the computer-readable instructions,when executed by the processor, cause the communication apparatus tofurther execute: in a case where a second connection request is receivedfrom a second external apparatus via the wireless interface under astate where the communication apparatus operates in a second operationmode different from the first operation mode, establishing a thirdwireless connection with the second external apparatus via the wirelessinterface, even if content of a predetermined area included in thesecond connection request is different from the specific content.
 7. Thecommunication apparatus as in claim 6, wherein the second operation modeis for executing an image processing in response to an execution requestof the image processing that is received from an external apparatus, andthe communication apparatus is caused to operate in the second operationmode in a case where a second instruction for causing the communicationapparatus to operate in the second operation mode is given under a statewhere the communication apparatus does not operate in the secondoperation mode, the communication apparatus further comprises an imageprocessing engine, and the computer-readable instructions, when executedby the processor, cause the communication apparatus to further execute:causing the image processing engine to execute the image processing in acase where the execution request is received from the second externalapparatus by using the third wireless connection.
 8. The communicationapparatus as in claim 1, wherein the computer-readable instructions,when executed by the processor, cause the communication apparatus tofurther execute: storing a MAC address of the target apparatus includedin the specific connection request in the memory, wherein thepredetermined area included in the first connection request is an areain which a MAC address of a sender apparatus is to be described, and thedetermining includes: determining that the first external apparatus isthe target apparatus in a case where a MAC address of the first externalapparatus described in the predetermined area is identical with the MACaddress of the target apparatus stored in the memory; and determiningthat the first external apparatus is not the target apparatus in a casewhere the MAC address of the first external apparatus described in thepredetermined area is not identical with the MAC address of the targetapparatus stored in the memory.
 9. The communication apparatus as inclaim 1, wherein the computer-readable instructions, when executed bythe processor, cause the communication apparatus to further execute:sending a response including a MAC address of the communicationapparatus to the target apparatus via the wireless interface in the casewhere the specific connection request including the predeterminedcharacter string is received from the target apparatus, wherein thepredetermined area included in the first connection request is an areain which a MAC address of a destination apparatus is to be described,and the determining includes: determining that the first externalapparatus is the target apparatus in a case where the MAC address of thecommunication apparatus is described in the predetermined area; anddetermining that the first external apparatus is not the targetapparatus in a case where the MAC address of the communication apparatusis not described in the predetermined area.
 10. The communicationapparatus as in claim 1, wherein the predetermined area included in thefirst connection request is an area in which an SSID (abbreviation ofService Set Identifier) is to be described, and the determiningincludes: determining that the first external apparatus is the targetapparatus in a case where nothing is described in the predeterminedarea; and determining that the first external apparatus is not thetarget apparatus in a case where an operating character string, whichindicates that the first external apparatus is operating in accordancewith Wi-Fi Direct (registered trademark), is described in thepredetermined area.
 11. The communication apparatus as in claim 1,wherein the predetermined area included in the first connection requestis an area in which an SSID (abbreviation of Service Set Identifier) isto be described, and the determining includes: determining that thefirst external apparatus is the target apparatus in a case where apredetermined SSID for identifying a wireless network where thecommunication apparatus operates as a parent station is described in thepredetermined area; and determining that the first external apparatus isnot the target apparatus in a case where the predetermined SSID is notdescribed in the predetermined area.
 12. A non-transitorycomputer-readable recording medium storing computer-readableinstructions for a communication apparatus, wherein thecomputer-readable instructions, when executed by a processor of thecommunication apparatus, cause the communication apparatus to execute:operating in one of a plurality of operation modes including a firstoperation mode for receiving specific information, which is to be usedby the communication apparatus, from a target apparatus which is to sendthe specific information to the communication apparatus so as to storethe specific information in a specific area in a memory of thecommunication apparatus; operating as a parent station of a specificwireless network in a case where a specific connection request includinga predetermined character string is received from the target apparatusunder a state where the communication apparatus operates in the firstoperation mode; determining whether a first external apparatus is thetarget apparatus by referring content of a predetermined area includedin a first connection request in a case where the first connectionrequest is received from the first external apparatus via a wirelessinterface of the communication apparatus after the communicationapparatus has operated as the parent station of the specific wirelessnetwork under the state where the communication apparatus operates inthe first operation mode; establishing a first wireless connection withthe first external apparatus via the wireless interface so as to causethe first external apparatus to participate in the specific wirelessnetwork as a child station in a case where it is determined that thefirst external apparatus is the target apparatus, wherein a wirelessconnection with the first external apparatus via the wireless interfaceis not established in a case where it is determined that the firstexternal apparatus is not the target apparatus; and storing the specificinformation in the specific area in a case where the specificinformation is received from the first external apparatus by using thefirst wireless connection after the first wireless connection with thefirst external apparatus has been established.